package ca.polymtl.rubikcube.util;

public class Color {
	public final int id;
	public final int red;
	public final int green;
	public final int blue;
	public final String name;

	public static final Color WHITE =  new Color(0, 255, 255, 255, "White");
	public static final Color BLUE =   new Color(1, 20,   20, 255, "Blue");
	public static final Color RED =    new Color(2, 255, 20,  0, "Red");
	public static final Color YELLOW = new Color(3, 255, 255, 0,   "Yellow");
	public static final Color GREEN =  new Color(4, 0,   255, 200,  "Green");
	public static final Color ORANGE = new Color(5, 255, 150,  0,   "Orange");
	public static final Color BLACK =  new Color(6, 0,   0,   0,   "Black");

	public static final Color[] colorsById = {
		WHITE,
		BLUE,
		RED,
		YELLOW,
		GREEN,
		ORANGE,
		BLACK
	};
	
	public static Color getColorById(int id) {
		return colorsById[id];
	}
	
	public Color(int id, int red, int green, int blue, String name) {
		this.id = id;
		this.red = red;
		this.green = green;
		this.blue = blue;
		this.name = name;
	}

	@Override
	public String toString() {
		//return "Color [id=" + id + ", red=" + red + ", green=" + green + ", blue=" + blue + ", name=" + name + "]";
		return this.name;
	}
	
	
}
